import { t } from '@src/locales'
/* components */
import BizListViewComponents from '@src/component/business/BizListView/BizListViewComponents'
import BizSelectColumn from '@src/component/business/BizSelectColumn/index'
import BaseSearchPanel from 'packages/BaseSearchPanel'
import BaseExport from '@src/component/common/BaseExport'
import BizTable from '@src/component/business/BizTable/BizTable.tsx'
import BaseSelectionBar from '@src/component/common/BaseSelectionBar/BaseSelectionBar.vue'
import BaseSelectionPanel from '@src/component/common/BaseSelectionPanel/BaseSelectionPanel.vue'
/* enum */
import AuthEnum from '@model/enum/AuthEnum'
import StorageModuleEnum from '@model/enum/StorageModuleEnum'
import StorageKeyEnum from '@model/enum/StorageKeyEnum'
/* entity */
import TaskType from '@model/entity/TaskType'
import Field from '@model/entity/Field'
/* model */
import Page from '@model/Page'
import ElementColumn from '@model/types/ElementColumn'
import Column from '@model/types/Column'
/* vue */
import { Ref, Prop } from 'vue-property-decorator'
import TaskTypeSimple from '@model/entity/TaskTypeSimple'

class BizListViewData<T, P> extends BizListViewComponents<T, P> {
  
  /* 导出组件 */
  @Ref() readonly BaseExportComponent!: BaseExport
  /* 表格组件 */
  @Ref() readonly BizTableComponent!: BizTable
  // @ts-ignore
  // 选择列组件
  @Ref() readonly BizSelectColumnComponent!: BizSelectColumn | any
  // 高级搜索组件
  @Ref() readonly BaseSearchPanelComponent!: BaseSearchPanel | any
  // 已选择条组件
  @Ref() readonly BaseSelectionBarComponent!: BaseSelectionBar | any
  // 已选择面板组件
  @Ref() readonly BaseSelectionPanelComponent!: BaseSelectionPanel | any

  
  /* 权限数据 */
  public auth: Record<AuthEnum | string, number> = {}
  /* 高级搜索栏数量 */
  public advancedColumnNumberKey: StorageKeyEnum = StorageKeyEnum.Empty
  /* 列表导出缓存 */
  public exportStorageKey: StorageKeyEnum = StorageKeyEnum.Empty
  /* 已选择面板列 */
  public baseSelectionPanelColumns: ElementColumn[] = []
  /* 列数据 */
  public columns: Column[] = []
  /* 高级搜索列宽几栏 */
  public columnNum: number = 1
  /* 导出文件名 */
  public exportFileName: string = t('common.base.data')
  /* 导出地址url */
  public exportActionUrl: string = ''
  /* 初始化数据 */
  public initData: any = {}
  /* 是否为表单模式导出下载 */
  public isExportDownloadFormMode: boolean = false
  /* 加载状态 */
  public loading: boolean = false
  /* 多选数据 */
  public multipleSelection: any[] = []
  /* 页面数据对象 */
  public page: Page = new Page()
  /* 搜索参数 */
  public searchParams: Record<string, any> = { keyword: '', orderDetail: {} }
  /* 选择列 缓存键名 */
  public selectColumnStorageKey: StorageKeyEnum = StorageKeyEnum.Empty
  /* pageSize 缓存键名 */
  public pageSizeStorageKey: StorageKeyEnum = StorageKeyEnum.Empty
  /* 缓存的模块名称 */
  public storageModule: StorageModuleEnum = StorageModuleEnum.Common
  /** 
   * 工单类型列表 对象
   * key : 工单类型id(string) -> value: TaskType
  */
  public taskTypesMap: Record<string, TaskType> = {}
  /* 是否显示高级搜索面板 */
  public visibleAdvancedSearchPanel: boolean = false
  /* 是否显示选择列弹窗 */
  public visibleSelectColumnDialog: boolean = false
  /* 搜索placeholder */
  public searchPlaceholder: string = t('common.placeholder.searchTask');

  public tableContainerHeight:string | undefined
  public packUp:boolean | undefined

  /* 高级搜索列 */
  public advanceSearchColumns: Field[] = []

  /* 高级搜索 条件 */
  public advancedSearchModel = {
    conditions: [],
    systemConditions: [],
  }

  /* 高级搜搜 常用 */
  public inCommonUse: string[] = []
}

export default BizListViewData

